<template>
	<template v-for="item in menuList" :key="item.id">
		<el-sub-menu v-if="item.children" :index="String(item.id)">
			<template #title>{{item.title}}</template>
			<MenuItem :menu-list="item.children"></MenuItem>
		</el-sub-menu>
		<el-menu-item v-else :index="String(item.id)">
			<span>{{item.title}}</span>
		</el-menu-item>
	</template>
</template>

<script>
export default {
	name: 'MenuItem',
	props: {
		menuList: {
			type: Array,
			default: () => []
		}
	}
}
</script>

<style>
</style>